<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__gpio.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">GPIO (General Purpose Input Output)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for configuring and interacting with general purpose input/outputs (GPIO). </p>
<p >The GPIO driver provides functions to configure and initialize GPIO, and to read and write data to the pin. The driver also supports interrupt generation on GPIO signals with rising, falling or both edges.</p>
<dl class="section note"><dt>Note</dt><dd>The APIs in this driver need not be used if a GPIO is to be used as an input or output of peripherals like I2C or PWM. The respective peripheral's driver will utilize the GPIO interface to configure and initialize its GPIO pins.</dd></dl>
<h1><a class="anchor" id="subsection_gpio_features"></a>
Features</h1>
<ul>
<li>Configurable GPIO pin direction - <a class="el" href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">cyhal_gpio_direction_t</a></li>
<li>Configurable GPIO pin drive modes - <a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a></li>
<li>Configurable analog and digital characteristics</li>
<li>Configurable edge-triggered interrupts and callback assignment on GPIO events - <a class="el" href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a></li>
</ul>
<h1><a class="anchor" id="subsection_gpio_quickstart"></a>
Quick Start</h1>
<p ><a class="el" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a> can be used for a simple GPIO initialization by providing the pin number (<b>pin</b>), pin direction (<b>direction</b>), pin drive mode (<b>drive_mode</b>) and the initial value on the pin (<b>init_val</b>).</p>
<h1><a class="anchor" id="subsection_gpio_sample_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_gpio_snippet_1"></a>
Snippet 1: Reading value from GPIO</h2>
<p >The following snippet initializes GPIO pin as an input with high impedance digital drive mode and initial value = <b>false</b> (low). A value is read from the pin and stored to a uint8_t variable (<b>read_val</b>).</p>
<div class="fragment"><div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line">    <span class="keywordtype">bool</span>      read_val;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize pin P0_0 as an input</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698">CYHAL_GPIO_DIR_INPUT</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394">CYHAL_GPIO_DRIVE_NONE</a>, <span class="keyword">false</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Read the logic level on the input pin</span></div>
<div class="line">    read_val = <a class="code hl_function" href="group__group__hal__gpio.html#ga3d38f1dd86c2e74b8ad10f1f6d1945c2">cyhal_gpio_read</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>);</div>
<div class="ttc" id="agroup__group__hal__gpio_html_ga3d38f1dd86c2e74b8ad10f1f6d1945c2"><div class="ttname"><a href="group__group__hal__gpio.html#ga3d38f1dd86c2e74b8ad10f1f6d1945c2">cyhal_gpio_read</a></div><div class="ttdeci">bool cyhal_gpio_read(cyhal_gpio_t pin)</div><div class="ttdoc">Read the input value.</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gab93322030909d3af6a9fc1a3b2eccbaa"><div class="ttname"><a href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a></div><div class="ttdeci">cy_rslt_t cyhal_gpio_init(cyhal_gpio_t pin, cyhal_gpio_direction_t direction, cyhal_gpio_drive_mode_t drive_mode, bool init_val)</div><div class="ttdoc">Initialize the GPIO pin   See Snippet 1: Reading value from GPIO.</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394"><div class="ttname"><a href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394">CYHAL_GPIO_DRIVE_NONE</a></div><div class="ttdeci">@ CYHAL_GPIO_DRIVE_NONE</div><div class="ttdoc">Digital Hi-Z.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:152</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698"><div class="ttname"><a href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698">CYHAL_GPIO_DIR_INPUT</a></div><div class="ttdeci">@ CYHAL_GPIO_DIR_INPUT</div><div class="ttdoc">Input pin.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:138</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a></div><div class="ttdeci">@ P0_0</div><div class="ttdoc">Port 0 Pin 0.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:55</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_gpio_snippet_2"></a>
Snippet 2: Writing value to a GPIO</h2>
<p >The following snippet initializes GPIO pin as an output pin with strong drive mode and initial value = <b>false</b> (low). A value = <b>true</b> (high) is written to the output driver.</p>
<div class="fragment"><div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line">    <span class="keywordtype">bool</span>      write_val = <span class="keyword">true</span>;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize pin P0_0 GPIO as an output with strong drive mode and initial value = false (low)</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec">CYHAL_GPIO_DIR_OUTPUT</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a>, <span class="keyword">false</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Write the value to the output pin</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, write_val);</div>
<div class="ttc" id="agroup__group__hal__gpio_html_gaf66e7c3ed7b3b0711635d7687ae92291"><div class="ttname"><a href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a></div><div class="ttdeci">void cyhal_gpio_write(cyhal_gpio_t pin, bool value)</div><div class="ttdoc">Set the output value for the pin.</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b"><div class="ttname"><a href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a></div><div class="ttdeci">@ CYHAL_GPIO_DRIVE_STRONG</div><div class="ttdoc">Strong output.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:158</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec"><div class="ttname"><a href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec">CYHAL_GPIO_DIR_OUTPUT</a></div><div class="ttdeci">@ CYHAL_GPIO_DIR_OUTPUT</div><div class="ttdoc">Output pin.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:139</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_gpio_snippet_3"></a>
Snippet 3: Reconfiguring a GPIO</h2>
<p >The following snippet shows how to reconfigure a GPIO pin during run-time using the firmware. The GPIO pin is first initialized as an output pin with strong drive mode. The pin is then reconfigured as an input with high impedance digital drive mode. </p><dl class="section note"><dt>Note</dt><dd><a class="el" href="group__group__hal__gpio.html#ga3e5ed18d7f97f80560131311281d3f4c">cyhal_gpio_configure</a> only changes the <b>direction</b> and the <b>drive_mode</b> of the pin. Previously set pin value is retained.</dd></dl>
<div class="fragment"><div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize pin P0_0 GPIO as an output with strong drive mode and initial value = false (low)</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec">CYHAL_GPIO_DIR_OUTPUT</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a>, <span class="keyword">false</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Application Code</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Re-configure pin P0_0 as an input pin</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__gpio.html#ga3e5ed18d7f97f80560131311281d3f4c">cyhal_gpio_configure</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698">CYHAL_GPIO_DIR_INPUT</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394">CYHAL_GPIO_DRIVE_NONE</a>);</div>
<div class="ttc" id="agroup__group__hal__gpio_html_ga3e5ed18d7f97f80560131311281d3f4c"><div class="ttname"><a href="group__group__hal__gpio.html#ga3e5ed18d7f97f80560131311281d3f4c">cyhal_gpio_configure</a></div><div class="ttdeci">cy_rslt_t cyhal_gpio_configure(cyhal_gpio_t pin, cyhal_gpio_direction_t direction, cyhal_gpio_drive_mode_t drive_mode)</div><div class="ttdoc">Configure the GPIO pin   See Snippet 3: Reconfiguring a GPIO.</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_gpio_snippet_4"></a>
Snippet 4: Interrupts on GPIO events</h2>
<p >GPIO events can be mapped to an interrupt and assigned to a callback function. The callback function needs to be first registered and then the event needs to be enabled. The following snippet initializes GPIO pin as an input pin. It registers a callback function and enables detection of a falling edge event to trigger the callback. </p><dl class="section note"><dt>Note</dt><dd>If no argument needs to be passed to the callback function then a NULL can be passed during registering. <br  />
</dd></dl>
<div class="fragment"><div class="line">uint32_t global_count = 0;</div>
<div class="line"><a class="code hl_struct" href="group__group__hal__gpio.html#structcyhal__gpio__callback__data__t">cyhal_gpio_callback_data_t</a> cb_data =</div>
<div class="line">{</div>
<div class="line">    .<a class="code hl_variable" href="group__group__hal__gpio.html#ac7a03146c870c549d695248448455750">callback</a>     = gpio_interrupt_handler,</div>
<div class="line">    .callback_arg = (<span class="keywordtype">void</span>*)&amp;global_count</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Interrupt handler callback function</span></div>
<div class="line"><span class="keywordtype">void</span> gpio_interrupt_handler(<span class="keywordtype">void</span>* handler_arg, <a class="code hl_enumeration" href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    CY_UNUSED_PARAMETER(event);</div>
<div class="line">    <span class="comment">// Increment global_count (passed as handler_arg) using a pointer</span></div>
<div class="line">    uint32_t* count = (uint32_t*)handler_arg;</div>
<div class="line">    *count = *count + 1;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Toggle pin P0_1 on every interrupt</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__gpio.html#gacf9c6cb7d4f6f25828a62d44648b745d">cyhal_gpio_toggle</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73">P0_1</a>);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_gpio_interrupt()</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize pin P0_0 GPIO as an input pin</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698">CYHAL_GPIO_DIR_INPUT</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394">CYHAL_GPIO_DRIVE_NONE</a>, <span class="keyword">false</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize pin P0_1 GPIO as an output with strong drive mode and initial value = true (high)</span></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73">P0_1</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec">CYHAL_GPIO_DIR_OUTPUT</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a>, <span class="keyword">true</span>);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Register callback function - gpio_interrupt_handler and pass the value global_count</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__gpio.html#gaaf872e66c1934c8166f386a55e74707c">cyhal_gpio_register_callback</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, &amp;cb_data);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Enable falling edge interrupt event with interrupt priority set to 3</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__gpio.html#ga0e0346810451d9940d31bb6111153593">cyhal_gpio_enable_event</a>(<a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__gpio.html#ggaa18cb21d1ea9d64311a7c8ddc6a27656a25be17b1b49dff67ca628b9fe6ae38f7">CYHAL_GPIO_IRQ_FALL</a>, 3, <span class="keyword">true</span>);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> rslt;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__gpio_html_ac7a03146c870c549d695248448455750"><div class="ttname"><a href="group__group__hal__gpio.html#ac7a03146c870c549d695248448455750">cyhal_gpio_callback_data_t::callback</a></div><div class="ttdeci">cyhal_gpio_event_callback_t callback</div><div class="ttdoc">The callback function to run.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:172</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_ga0e0346810451d9940d31bb6111153593"><div class="ttname"><a href="group__group__hal__gpio.html#ga0e0346810451d9940d31bb6111153593">cyhal_gpio_enable_event</a></div><div class="ttdeci">void cyhal_gpio_enable_event(cyhal_gpio_t pin, cyhal_gpio_event_t event, uint8_t intr_priority, bool enable)</div><div class="ttdoc">Enable or Disable the specified GPIO event</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gaa18cb21d1ea9d64311a7c8ddc6a27656"><div class="ttname"><a href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a></div><div class="ttdeci">cyhal_gpio_event_t</div><div class="ttdoc">Pin events.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:128</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gaaf872e66c1934c8166f386a55e74707c"><div class="ttname"><a href="group__group__hal__gpio.html#gaaf872e66c1934c8166f386a55e74707c">cyhal_gpio_register_callback</a></div><div class="ttdeci">void cyhal_gpio_register_callback(cyhal_gpio_t pin, cyhal_gpio_callback_data_t *callback_data)</div><div class="ttdoc">Register/clear a callback handler for pin events</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_gacf9c6cb7d4f6f25828a62d44648b745d"><div class="ttname"><a href="group__group__hal__gpio.html#gacf9c6cb7d4f6f25828a62d44648b745d">cyhal_gpio_toggle</a></div><div class="ttdeci">void cyhal_gpio_toggle(cyhal_gpio_t pin)</div><div class="ttdoc">Toggle the output value   See Snippet 4: Interrupts on GPIO events.</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_ggaa18cb21d1ea9d64311a7c8ddc6a27656a25be17b1b49dff67ca628b9fe6ae38f7"><div class="ttname"><a href="group__group__hal__gpio.html#ggaa18cb21d1ea9d64311a7c8ddc6a27656a25be17b1b49dff67ca628b9fe6ae38f7">CYHAL_GPIO_IRQ_FALL</a></div><div class="ttdeci">@ CYHAL_GPIO_IRQ_FALL</div><div class="ttdoc">Interrupt on falling edge.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:131</div></div>
<div class="ttc" id="agroup__group__hal__gpio_html_structcyhal__gpio__callback__data__t"><div class="ttname"><a href="group__group__hal__gpio.html#structcyhal__gpio__callback__data__t">cyhal_gpio_callback_data_t</a></div><div class="ttdoc">Structure containing callback data for pins.</div><div class="ttdef"><b>Definition:</b> cyhal_gpio.h:171</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73">P0_1</a></div><div class="ttdeci">@ P0_1</div><div class="ttdoc">Port 0 Pin 1.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:56</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__gpio"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__gpio.html">GPIO HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__gpio"><td class="mdescLeft">&#160;</td><td class="mdescRight">GPIO specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcyhal__gpio__callback__data__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#structcyhal__gpio__callback__data__t">cyhal_gpio_callback_data_t</a></td></tr>
<tr class="memdesc:structcyhal__gpio__callback__data__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure containing callback data for pins.  <a href="group__group__hal__gpio.html#structcyhal__gpio__callback__data__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__gpio__callback__data__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga25a61e0d5a27c77dca1c7709fba9c400"><td class="memItemLeft" align="right" valign="top"><a id="ga25a61e0d5a27c77dca1c7709fba9c400" name="ga25a61e0d5a27c77dca1c7709fba9c400"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_NC_PIN_VALUE</b>&#160;&#160;&#160;(<a class="el" href="group__group__hal__impl__pin__package__xmc7200__320__bga.html#ggad38839a2406ac562d708d7639fbff225a3dbd1016ea99d087d747530418b89a01">NC</a>)</td></tr>
<tr class="memdesc:ga25a61e0d5a27c77dca1c7709fba9c400"><td class="mdescLeft">&#160;</td><td class="mdescRight">Integer representation of no connect pin (required to exist in all BSPs) <br /></td></tr>
<tr class="separator:ga25a61e0d5a27c77dca1c7709fba9c400"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga4a82d25582991576faba92d30a5da881"><td class="memItemLeft" align="right" valign="top"><a id="ga4a82d25582991576faba92d30a5da881" name="ga4a82d25582991576faba92d30a5da881"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_gpio_event_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a> event)</td></tr>
<tr class="memdesc:ga4a82d25582991576faba92d30a5da881"><td class="mdescLeft">&#160;</td><td class="mdescRight">GPIO callback function type. <br /></td></tr>
<tr class="separator:ga4a82d25582991576faba92d30a5da881"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaa18cb21d1ea9d64311a7c8ddc6a27656"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#ggaa18cb21d1ea9d64311a7c8ddc6a27656aa7946bc42b986d4739a0917d156daa96">CYHAL_GPIO_IRQ_NONE</a> = 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#ggaa18cb21d1ea9d64311a7c8ddc6a27656a4e34bdb4db6023a4c502c29e2b435096">CYHAL_GPIO_IRQ_RISE</a> = 1 &lt;&lt; 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#ggaa18cb21d1ea9d64311a7c8ddc6a27656a25be17b1b49dff67ca628b9fe6ae38f7">CYHAL_GPIO_IRQ_FALL</a> = 1 &lt;&lt; 1
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#ggaa18cb21d1ea9d64311a7c8ddc6a27656a966472a025b6099a9c758c22975ab8d7">CYHAL_GPIO_IRQ_BOTH</a> = (CYHAL_GPIO_IRQ_RISE | CYHAL_GPIO_IRQ_FALL)
<br />
 }</td></tr>
<tr class="memdesc:gaa18cb21d1ea9d64311a7c8ddc6a27656"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pin events.  <a href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">More...</a><br /></td></tr>
<tr class="separator:gaa18cb21d1ea9d64311a7c8ddc6a27656"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54f023b4b455556095b64f4f5d7e3446"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">cyhal_gpio_direction_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698">CYHAL_GPIO_DIR_INPUT</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec">CYHAL_GPIO_DIR_OUTPUT</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446aa74cc25a065acefdf521cfd5e5840fbe">CYHAL_GPIO_DIR_BIDIRECTIONAL</a>
<br />
 }</td></tr>
<tr class="memdesc:ga54f023b4b455556095b64f4f5d7e3446"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pin direction.  <a href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">More...</a><br /></td></tr>
<tr class="separator:ga54f023b4b455556095b64f4f5d7e3446"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2eb76143375648febb0ef73f00a681b2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394">CYHAL_GPIO_DRIVE_NONE</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2add31d230860a15fb28b1c51aeb34f3d7">CYHAL_GPIO_DRIVE_ANALOG</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a062567632c803124bc394a1e0ea36e80">CYHAL_GPIO_DRIVE_PULLUP</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2aa71fcf0c207fb35936fe3e41c39ff043">CYHAL_GPIO_DRIVE_PULLDOWN</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a9c51fc7bcc4196c011af96495d358d95">CYHAL_GPIO_DRIVE_OPENDRAINDRIVESLOW</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2ae233e78cc7f6df331630ef11c243a9ac">CYHAL_GPIO_DRIVE_OPENDRAINDRIVESHIGH</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a42913f4c174583d37970c81aa6a20a5a">CYHAL_GPIO_DRIVE_PULLUPDOWN</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2abe59e87a4fa3903889d94d13b2f09a38">CYHAL_GPIO_DRIVE_PULL_NONE</a>
<br />
 }</td></tr>
<tr class="memdesc:ga2eb76143375648febb0ef73f00a681b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pin drive mode.  <a href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">More...</a><br /></td></tr>
<tr class="separator:ga2eb76143375648febb0ef73f00a681b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab93322030909d3af6a9fc1a3b2eccbaa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">cyhal_gpio_init</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, <a class="el" href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">cyhal_gpio_direction_t</a> direction, <a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a> drive_mode, bool init_val)</td></tr>
<tr class="memdesc:gab93322030909d3af6a9fc1a3b2eccbaa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the GPIO pin <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_1">Snippet 1: Reading value from GPIO</a>.  <a href="group__group__hal__gpio.html#gab93322030909d3af6a9fc1a3b2eccbaa">More...</a><br /></td></tr>
<tr class="separator:gab93322030909d3af6a9fc1a3b2eccbaa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae5ef384dcdef1d08d4a9e88592bda173"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gae5ef384dcdef1d08d4a9e88592bda173">cyhal_gpio_free</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin)</td></tr>
<tr class="memdesc:gae5ef384dcdef1d08d4a9e88592bda173"><td class="mdescLeft">&#160;</td><td class="mdescRight">Uninitialize the gpio peripheral and the cyhal_gpio_t object.  <a href="group__group__hal__gpio.html#gae5ef384dcdef1d08d4a9e88592bda173">More...</a><br /></td></tr>
<tr class="separator:gae5ef384dcdef1d08d4a9e88592bda173"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3e5ed18d7f97f80560131311281d3f4c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#ga3e5ed18d7f97f80560131311281d3f4c">cyhal_gpio_configure</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, <a class="el" href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">cyhal_gpio_direction_t</a> direction, <a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a> drive_mode)</td></tr>
<tr class="memdesc:ga3e5ed18d7f97f80560131311281d3f4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the GPIO pin <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_3">Snippet 3: Reconfiguring a GPIO</a>.  <a href="group__group__hal__gpio.html#ga3e5ed18d7f97f80560131311281d3f4c">More...</a><br /></td></tr>
<tr class="separator:ga3e5ed18d7f97f80560131311281d3f4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf66e7c3ed7b3b0711635d7687ae92291"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">cyhal_gpio_write</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, bool value)</td></tr>
<tr class="memdesc:gaf66e7c3ed7b3b0711635d7687ae92291"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the output value for the pin.  <a href="group__group__hal__gpio.html#gaf66e7c3ed7b3b0711635d7687ae92291">More...</a><br /></td></tr>
<tr class="separator:gaf66e7c3ed7b3b0711635d7687ae92291"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d38f1dd86c2e74b8ad10f1f6d1945c2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#ga3d38f1dd86c2e74b8ad10f1f6d1945c2">cyhal_gpio_read</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin)</td></tr>
<tr class="memdesc:ga3d38f1dd86c2e74b8ad10f1f6d1945c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the input value.  <a href="group__group__hal__gpio.html#ga3d38f1dd86c2e74b8ad10f1f6d1945c2">More...</a><br /></td></tr>
<tr class="separator:ga3d38f1dd86c2e74b8ad10f1f6d1945c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacf9c6cb7d4f6f25828a62d44648b745d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gacf9c6cb7d4f6f25828a62d44648b745d">cyhal_gpio_toggle</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin)</td></tr>
<tr class="memdesc:gacf9c6cb7d4f6f25828a62d44648b745d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Toggle the output value <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_4">Snippet 4: Interrupts on GPIO events</a>.  <a href="group__group__hal__gpio.html#gacf9c6cb7d4f6f25828a62d44648b745d">More...</a><br /></td></tr>
<tr class="separator:gacf9c6cb7d4f6f25828a62d44648b745d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf872e66c1934c8166f386a55e74707c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gaaf872e66c1934c8166f386a55e74707c">cyhal_gpio_register_callback</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, <a class="el" href="group__group__hal__gpio.html#structcyhal__gpio__callback__data__t">cyhal_gpio_callback_data_t</a> *callback_data)</td></tr>
<tr class="memdesc:gaaf872e66c1934c8166f386a55e74707c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register/clear a callback handler for pin events <br  />
  <a href="group__group__hal__gpio.html#gaaf872e66c1934c8166f386a55e74707c">More...</a><br /></td></tr>
<tr class="separator:gaaf872e66c1934c8166f386a55e74707c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e0346810451d9940d31bb6111153593"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#ga0e0346810451d9940d31bb6111153593">cyhal_gpio_enable_event</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, <a class="el" href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:ga0e0346810451d9940d31bb6111153593"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable or Disable the specified GPIO event <br  />
  <a href="group__group__hal__gpio.html#ga0e0346810451d9940d31bb6111153593">More...</a><br /></td></tr>
<tr class="separator:ga0e0346810451d9940d31bb6111153593"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga623da00e703151da3b4c5a416084f5c3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#ga623da00e703151da3b4c5a416084f5c3">cyhal_gpio_connect_digital</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source)</td></tr>
<tr class="memdesc:ga623da00e703151da3b4c5a416084f5c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects a source signal and enables an input to a pin that, when triggered, will set the pins output.  <a href="group__group__hal__gpio.html#ga623da00e703151da3b4c5a416084f5c3">More...</a><br /></td></tr>
<tr class="separator:ga623da00e703151da3b4c5a416084f5c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga00456a2ae97cf0f3cd39b622d96dc0e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#ga00456a2ae97cf0f3cd39b622d96dc0e9">cyhal_gpio_enable_output</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, <a class="el" href="group__group__hal__general__types.html#ga801c21c8f1d529c8d189990ce6825080">cyhal_signal_type_t</a> type, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *source)</td></tr>
<tr class="memdesc:ga00456a2ae97cf0f3cd39b622d96dc0e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables an output signal from a pin that is triggered by the pins input.  <a href="group__group__hal__gpio.html#ga00456a2ae97cf0f3cd39b622d96dc0e9">More...</a><br /></td></tr>
<tr class="separator:ga00456a2ae97cf0f3cd39b622d96dc0e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac6f3fcfce78d38839a273ec6a86b1f72"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gac6f3fcfce78d38839a273ec6a86b1f72">cyhal_gpio_disconnect_digital</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source)</td></tr>
<tr class="memdesc:gac6f3fcfce78d38839a273ec6a86b1f72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnects a source signal and disables an input to a pin.  <a href="group__group__hal__gpio.html#gac6f3fcfce78d38839a273ec6a86b1f72">More...</a><br /></td></tr>
<tr class="separator:gac6f3fcfce78d38839a273ec6a86b1f72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae570322f2a9c9e7c33e91c1807cd65e3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__gpio.html#gae570322f2a9c9e7c33e91c1807cd65e3">cyhal_gpio_disable_output</a> (<a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> pin)</td></tr>
<tr class="memdesc:gae570322f2a9c9e7c33e91c1807cd65e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables an output signal from a pin.  <a href="group__group__hal__gpio.html#gae570322f2a9c9e7c33e91c1807cd65e3">More...</a><br /></td></tr>
<tr class="separator:gae570322f2a9c9e7c33e91c1807cd65e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcyhal__gpio__callback__data__t" id="structcyhal__gpio__callback__data__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__gpio__callback__data__t">&#9670;&nbsp;</a></span>cyhal_gpio_callback_data_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_gpio_callback_data_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="ac7a03146c870c549d695248448455750" name="ac7a03146c870c549d695248448455750"></a><a class="el" href="group__group__hal__gpio.html#ga4a82d25582991576faba92d30a5da881">cyhal_gpio_event_callback_t</a></td>
<td class="fieldname">
callback</td>
<td class="fielddoc">
The callback function to run. </td></tr>
<tr><td class="fieldtype">
<a id="a76e7b6816d6677dd0760e73840c35dc5" name="a76e7b6816d6677dd0760e73840c35dc5"></a>void *</td>
<td class="fieldname">
callback_arg</td>
<td class="fielddoc">
Optional argument for the callback. </td></tr>
<tr><td class="fieldtype">
<a id="a29e6028de322954d5d4ed0c9f68060cd" name="a29e6028de322954d5d4ed0c9f68060cd"></a>struct cyhal_gpio_callback_data_s *</td>
<td class="fieldname">
next</td>
<td class="fielddoc">
NULL. <p >Filled in by the HAL driver </p>
</td></tr>
<tr><td class="fieldtype">
<a id="adf08cc4c443eb36d53cc943ddd1447a4" name="adf08cc4c443eb36d53cc943ddd1447a4"></a><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a></td>
<td class="fieldname">
pin</td>
<td class="fielddoc">
NC. <p >Filled in by the HAL driver </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gaa18cb21d1ea9d64311a7c8ddc6a27656" name="gaa18cb21d1ea9d64311a7c8ddc6a27656"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa18cb21d1ea9d64311a7c8ddc6a27656">&#9670;&nbsp;</a></span>cyhal_gpio_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pin events. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaa18cb21d1ea9d64311a7c8ddc6a27656aa7946bc42b986d4739a0917d156daa96" name="ggaa18cb21d1ea9d64311a7c8ddc6a27656aa7946bc42b986d4739a0917d156daa96"></a>CYHAL_GPIO_IRQ_NONE&#160;</td><td class="fielddoc"><p >No interrupt. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa18cb21d1ea9d64311a7c8ddc6a27656a4e34bdb4db6023a4c502c29e2b435096" name="ggaa18cb21d1ea9d64311a7c8ddc6a27656a4e34bdb4db6023a4c502c29e2b435096"></a>CYHAL_GPIO_IRQ_RISE&#160;</td><td class="fielddoc"><p >Interrupt on rising edge. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa18cb21d1ea9d64311a7c8ddc6a27656a25be17b1b49dff67ca628b9fe6ae38f7" name="ggaa18cb21d1ea9d64311a7c8ddc6a27656a25be17b1b49dff67ca628b9fe6ae38f7"></a>CYHAL_GPIO_IRQ_FALL&#160;</td><td class="fielddoc"><p >Interrupt on falling edge. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa18cb21d1ea9d64311a7c8ddc6a27656a966472a025b6099a9c758c22975ab8d7" name="ggaa18cb21d1ea9d64311a7c8ddc6a27656a966472a025b6099a9c758c22975ab8d7"></a>CYHAL_GPIO_IRQ_BOTH&#160;</td><td class="fielddoc"><p >Interrupt on both rising and falling edges. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga54f023b4b455556095b64f4f5d7e3446" name="ga54f023b4b455556095b64f4f5d7e3446"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54f023b4b455556095b64f4f5d7e3446">&#9670;&nbsp;</a></span>cyhal_gpio_direction_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">cyhal_gpio_direction_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pin direction. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698" name="gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698"></a>CYHAL_GPIO_DIR_INPUT&#160;</td><td class="fielddoc"><p >Input pin. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec" name="gga54f023b4b455556095b64f4f5d7e3446a846ce42fac8d332495aaa45b93d671ec"></a>CYHAL_GPIO_DIR_OUTPUT&#160;</td><td class="fielddoc"><p >Output pin. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga54f023b4b455556095b64f4f5d7e3446aa74cc25a065acefdf521cfd5e5840fbe" name="gga54f023b4b455556095b64f4f5d7e3446aa74cc25a065acefdf521cfd5e5840fbe"></a>CYHAL_GPIO_DIR_BIDIRECTIONAL&#160;</td><td class="fielddoc"><p >Input and output pin. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga2eb76143375648febb0ef73f00a681b2" name="ga2eb76143375648febb0ef73f00a681b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2eb76143375648febb0ef73f00a681b2">&#9670;&nbsp;</a></span>cyhal_gpio_drive_mode_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pin drive mode. </p>
<dl class="section note"><dt>Note</dt><dd>When the <b> drive_mode </b> of the <b> pin </b> is set to <b> CYHAL_GPIO_DRIVE_PULL_NONE </b>, it is set to <b> CYHAL_GPIO_DRIVE_STRONG </b> if the <b> direction </b> of the <b> pin </b> is <b> CYHAL_GPIO_DIR_OUTPUT </b> or <b> CYHAL_GPIO_DIR_BIDIRECTIONAL</b>. If not, the <b> drive_mode </b> of the <b> pin </b> is set to <b> CYHAL_GPIO_DRIVE_NONE</b>. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394" name="gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394"></a>CYHAL_GPIO_DRIVE_NONE&#160;</td><td class="fielddoc"><p >Digital Hi-Z. </p>
<p >Input only. Input init value(s): 0 or 1 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2add31d230860a15fb28b1c51aeb34f3d7" name="gga2eb76143375648febb0ef73f00a681b2add31d230860a15fb28b1c51aeb34f3d7"></a>CYHAL_GPIO_DRIVE_ANALOG&#160;</td><td class="fielddoc"><p >Analog Hi-Z. </p>
<p >Use only for analog purpose </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2a062567632c803124bc394a1e0ea36e80" name="gga2eb76143375648febb0ef73f00a681b2a062567632c803124bc394a1e0ea36e80"></a>CYHAL_GPIO_DRIVE_PULLUP&#160;</td><td class="fielddoc"><p >Pull-up resistor. </p>
<p >Input and output. Input init value(s): 1, output value(s): 0 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2aa71fcf0c207fb35936fe3e41c39ff043" name="gga2eb76143375648febb0ef73f00a681b2aa71fcf0c207fb35936fe3e41c39ff043"></a>CYHAL_GPIO_DRIVE_PULLDOWN&#160;</td><td class="fielddoc"><p >Pull-down resistor. </p>
<p >Input and output. Input init value(s): 0, output value(s): 1 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2a9c51fc7bcc4196c011af96495d358d95" name="gga2eb76143375648febb0ef73f00a681b2a9c51fc7bcc4196c011af96495d358d95"></a>CYHAL_GPIO_DRIVE_OPENDRAINDRIVESLOW&#160;</td><td class="fielddoc"><p >Open-drain, Drives Low. </p>
<p >Input and output. Input init value(s): 1, output value(s): 0 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2ae233e78cc7f6df331630ef11c243a9ac" name="gga2eb76143375648febb0ef73f00a681b2ae233e78cc7f6df331630ef11c243a9ac"></a>CYHAL_GPIO_DRIVE_OPENDRAINDRIVESHIGH&#160;</td><td class="fielddoc"><p >Open-drain, Drives High. </p>
<p >Input and output. Input init value(s): 0, output value(s): 1 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b" name="gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b"></a>CYHAL_GPIO_DRIVE_STRONG&#160;</td><td class="fielddoc"><p >Strong output. </p>
<p >Output only. Output init value(s): 0 or 1 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2a42913f4c174583d37970c81aa6a20a5a" name="gga2eb76143375648febb0ef73f00a681b2a42913f4c174583d37970c81aa6a20a5a"></a>CYHAL_GPIO_DRIVE_PULLUPDOWN&#160;</td><td class="fielddoc"><p >Pull-up and pull-down resistors. </p>
<p >Input and output. Input init value(s): 0 or 1, output value(s): 0 or 1 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2eb76143375648febb0ef73f00a681b2abe59e87a4fa3903889d94d13b2f09a38" name="gga2eb76143375648febb0ef73f00a681b2abe59e87a4fa3903889d94d13b2f09a38"></a>CYHAL_GPIO_DRIVE_PULL_NONE&#160;</td><td class="fielddoc"><p >No Pull-up or pull-down resistors. </p>
<p >Input and output. Input init value(s): 0 or 1, output value(s): 0 or 1 </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab93322030909d3af6a9fc1a3b2eccbaa" name="gab93322030909d3af6a9fc1a3b2eccbaa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab93322030909d3af6a9fc1a3b2eccbaa">&#9670;&nbsp;</a></span>cyhal_gpio_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_gpio_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">cyhal_gpio_direction_t</a>&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a>&#160;</td>
          <td class="paramname"><em>drive_mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>init_val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the GPIO pin <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_1">Snippet 1: Reading value from GPIO</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>The GPIO pin to initialize </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">direction</td><td>The pin direction </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">drive_mode</td><td>The pin drive mode </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">init_val</td><td>Initial value on the pin</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request</dd></dl>
<p>Guidance for using gpio drive modes ( <a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a> for details). For default use drive modes: Input GPIO direction - <a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a181685dd155f58d036420b61778a7394">CYHAL_GPIO_DRIVE_NONE</a> Output GPIO direction - <a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a> Bidirectional GPIO - <a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a42913f4c174583d37970c81aa6a20a5a">CYHAL_GPIO_DRIVE_PULLUPDOWN</a> </p><dl class="section warning"><dt>Warning</dt><dd>Don't use <a class="el" href="group__group__hal__gpio.html#gga2eb76143375648febb0ef73f00a681b2a697e0520cb1b71b748bb76eaafb3ad1b">CYHAL_GPIO_DRIVE_STRONG</a> for input GPIO direction. It may cause an overcurrent issue. </dd></dl>

</div>
</div>
<a id="gae5ef384dcdef1d08d4a9e88592bda173" name="gae5ef384dcdef1d08d4a9e88592bda173"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae5ef384dcdef1d08d4a9e88592bda173">&#9670;&nbsp;</a></span>cyhal_gpio_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_gpio_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Uninitialize the gpio peripheral and the cyhal_gpio_t object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>Pin number </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga3e5ed18d7f97f80560131311281d3f4c" name="ga3e5ed18d7f97f80560131311281d3f4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3e5ed18d7f97f80560131311281d3f4c">&#9670;&nbsp;</a></span>cyhal_gpio_configure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_gpio_configure </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__gpio.html#ga54f023b4b455556095b64f4f5d7e3446">cyhal_gpio_direction_t</a>&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__gpio.html#ga2eb76143375648febb0ef73f00a681b2">cyhal_gpio_drive_mode_t</a>&#160;</td>
          <td class="paramname"><em>drive_mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure the GPIO pin <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_3">Snippet 3: Reconfiguring a GPIO</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>The GPIO pin </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">direction</td><td>The pin direction </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">drive_mode</td><td>The pin drive mode</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the configure request </dd></dl>

</div>
</div>
<a id="gaf66e7c3ed7b3b0711635d7687ae92291" name="gaf66e7c3ed7b3b0711635d7687ae92291"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf66e7c3ed7b3b0711635d7687ae92291">&#9670;&nbsp;</a></span>cyhal_gpio_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_gpio_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the output value for the pin. </p>
<p >This only works for output &amp; in_out pins. <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_2">Snippet 2: Writing value to a GPIO</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>The GPIO object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to be set (high = true, low = false) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga3d38f1dd86c2e74b8ad10f1f6d1945c2" name="ga3d38f1dd86c2e74b8ad10f1f6d1945c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d38f1dd86c2e74b8ad10f1f6d1945c2">&#9670;&nbsp;</a></span>cyhal_gpio_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_gpio_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read the input value. </p>
<p >This only works for <a class="el" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446a0b8ce046272e1971aea1248bd86f2698">CYHAL_GPIO_DIR_INPUT</a> &amp; <a class="el" href="group__group__hal__gpio.html#gga54f023b4b455556095b64f4f5d7e3446aa74cc25a065acefdf521cfd5e5840fbe">CYHAL_GPIO_DIR_BIDIRECTIONAL</a> pins. <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_1">Snippet 1: Reading value from GPIO</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>The GPIO object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The value of the IO (true = high, false = low) </dd></dl>

</div>
</div>
<a id="gacf9c6cb7d4f6f25828a62d44648b745d" name="gacf9c6cb7d4f6f25828a62d44648b745d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacf9c6cb7d4f6f25828a62d44648b745d">&#9670;&nbsp;</a></span>cyhal_gpio_toggle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_gpio_toggle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Toggle the output value <br  />
 See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_4">Snippet 4: Interrupts on GPIO events</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>The GPIO object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaaf872e66c1934c8166f386a55e74707c" name="gaaf872e66c1934c8166f386a55e74707c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf872e66c1934c8166f386a55e74707c">&#9670;&nbsp;</a></span>cyhal_gpio_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_gpio_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__gpio.html#structcyhal__gpio__callback__data__t">cyhal_gpio_callback_data_t</a> *&#160;</td>
          <td class="paramname"><em>callback_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register/clear a callback handler for pin events <br  />
 </p>
<p >The referenced function will be called when one of the events enabled by <a class="el" href="group__group__hal__gpio.html#ga0e0346810451d9940d31bb6111153593">cyhal_gpio_enable_event</a> occurs.</p>
<p >See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_4">Snippet 4: Interrupts on GPIO events</a>.</p>
<dl class="section note"><dt>Note</dt><dd>The signature for this function is slightly different from other HAL register_callback functions. This is because the cyhal_gpio_t is a enum value and not a pointer to a struct. This prevents storing the callback information on the instance object itself. So instead we need a different mechanism to keep track of this data.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>The GPIO object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_data</td><td>The callback data to register. Use NULL to unregister. This object must persist for the length of time the callback is registered. As such, it should not be declared on the stack. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga0e0346810451d9940d31bb6111153593" name="ga0e0346810451d9940d31bb6111153593"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0e0346810451d9940d31bb6111153593">&#9670;&nbsp;</a></span>cyhal_gpio_enable_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_gpio_enable_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__gpio.html#gaa18cb21d1ea9d64311a7c8ddc6a27656">cyhal_gpio_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable or Disable the specified GPIO event <br  />
 </p>
<p >When an enabled event occurs, the function specified by <a class="el" href="group__group__hal__gpio.html#gaaf872e66c1934c8166f386a55e74707c">cyhal_gpio_register_callback</a> will be called.</p>
<p >See <a class="el" href="group__group__hal__gpio.html#subsection_gpio_snippet_4">Snippet 4: Interrupts on GPIO events</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>The GPIO object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The GPIO event </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events. Interrupt priorities specific to a pin may not be supported on all platforms. Refer to platform implementation specific documentation for details. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on interrupts, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga623da00e703151da3b4c5a416084f5c3" name="ga623da00e703151da3b4c5a416084f5c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga623da00e703151da3b4c5a416084f5c3">&#9670;&nbsp;</a></span>cyhal_gpio_connect_digital()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_gpio_connect_digital </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connects a source signal and enables an input to a pin that, when triggered, will set the pins output. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>GPIO object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal obtained from another driver's cyhal_&lt;PERIPH&gt;_enable_output </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the connection </dd></dl>

</div>
</div>
<a id="ga00456a2ae97cf0f3cd39b622d96dc0e9" name="ga00456a2ae97cf0f3cd39b622d96dc0e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga00456a2ae97cf0f3cd39b622d96dc0e9">&#9670;&nbsp;</a></span>cyhal_gpio_enable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_gpio_enable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__general__types.html#ga801c21c8f1d529c8d189990ce6825080">cyhal_signal_type_t</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables an output signal from a pin that is triggered by the pins input. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>GPIO object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>Whether the signal will act as a edge or level input </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">source</td><td>Pointer to user-allocated source signal object which will be initialized by enable_output. <code>source</code> should be passed to (dis)connect_digital functions to (dis)connect the associated endpoints. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output enable </dd></dl>

</div>
</div>
<a id="gac6f3fcfce78d38839a273ec6a86b1f72" name="gac6f3fcfce78d38839a273ec6a86b1f72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac6f3fcfce78d38839a273ec6a86b1f72">&#9670;&nbsp;</a></span>cyhal_gpio_disconnect_digital()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_gpio_disconnect_digital </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disconnects a source signal and disables an input to a pin. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>GPIO object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal from cyhal_&lt;PERIPH&gt;_enable_output to disable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the disconnection </dd></dl>

</div>
</div>
<a id="gae570322f2a9c9e7c33e91c1807cd65e3" name="gae570322f2a9c9e7c33e91c1807cd65e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae570322f2a9c9e7c33e91c1807cd65e3">&#9670;&nbsp;</a></span>cyhal_gpio_disable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_gpio_disable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>pin</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables an output signal from a pin. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pin</td><td>GPIO object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output enable </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
